from django.db import models
from django.utils import timezone

from user.models import User


# Create your models here.

class Group(models.Model):
    name = models.CharField(max_length=50, db_comment='人员组名称')
    create_time = models.DateTimeField(db_comment='创建时间', default=timezone.now, blank=True, null=True)
    update_time = models.DateTimeField(db_comment='修改时间', blank=True, null=True)
    delete_time = models.DateTimeField(db_comment='删除时间', blank=True, null=True)
    is_delete = models.BooleanField(db_comment='是否删除', default=False)
    users = models.ManyToManyField(to=User,
                                   db_table='tb_group_user',
                                   blank=True)

    class Meta:
        db_table = 'tb_group'
